<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "q_admin_log_all".
 *
 * @property int $id 日志主键
 * @property int $uid 用户id
 * @property string $ip 访客ip
 * @property string $location 访客地址
 * @property string $os 操作系统
 * @property string $browser 浏览器
 * @property string $url url
 * @property string $module 模块
 * @property string $controller 控制器
 * @property string $action 方法
 * @property string $method 请求方式
 * @property string|null $data 请求的param数据，serialize后的
 * @property string $user_agent
 * @property int $create_at 操作时间
 */
class AdminLog extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'q_admin_log_all';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['uid', 'create_at'], 'integer'],
            [['data'], 'string'],
            [['ip'], 'string', 'max' => 15],
            [['location', 'os', 'browser', 'url', 'module', 'controller', 'action'], 'string', 'max' => 255],
            [['method'], 'string', 'max' => 6],
            [['user_agent'], 'string', 'max' => 512],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid' => 'Uid',
            'ip' => 'Ip',
            'location' => 'Location',
            'os' => 'Os',
            'browser' => 'Browser',
            'url' => 'Url',
            'module' => 'Module',
            'controller' => 'Controller',
            'action' => 'Action',
            'method' => 'Method',
            'data' => 'Data',
            'user_agent' => 'User Agent',
            'create_at' => 'Create At',
        ];
    }
}
